package com.wkb.design.createModing.prototype;

import java.util.ArrayList;

import com.wkb.design.createModing.prototype.factory.ILifeFactory;
import com.wkb.design.createModing.prototype.factory.impl.LifeFactoryImpl;
import com.wkb.design.createModing.prototype.pojo.DayLife;

/**  
 * @author wkb 
 * @version 创建时间：2013-6-14 上午11:50:21  
 * 类说明
 */
public class MainApp {

	public static void main(String[] args) {
		
		MainApp mainApp = new MainApp();
//		mainApp.testOrdinary();
		mainApp.ioClone();
		
	}
	
	
	public void testOrdinary(){
		
		ILifeFactory liftFactory = new LifeFactoryImpl();
		liftFactory.getDayLifeInstance().print();
		DayLife dayLife = liftFactory.getDayLifeInstance();
		dayLife.setGetUp("懒床了，早上10点才起床");
		dayLife.setByBus(2);
		ArrayList<String> str = new ArrayList<String>();
		str.add("1");
		dayLife.setOpenTv(str);
		DayLife dayLifeNew = liftFactory.getDayLifeInstance();
		
		if(dayLife == dayLifeNew){
			System.out.println("I am same!");
		}
		
		dayLife.print();
		dayLifeNew.print();
	}
	
	public void ioClone(){
		
		ILifeFactory liftFactory = new LifeFactoryImpl();
		liftFactory.getDayLifeInstByIo().print();
		DayLife dayLife = liftFactory.getDayLifeInstByIo();
		dayLife.setGetUp("Io克隆，早上10点才起床");
		dayLife.setByBus(3);
		ArrayList<String> str = new ArrayList<String>();
		str.add("Io克隆");
		dayLife.setOpenTv(str);
		DayLife dayLifeNew = liftFactory.getDayLifeInstByIo();
		
		if(dayLife == dayLifeNew){
			System.out.println("I am same!");
		}
		
		dayLife.print();
		dayLifeNew.print();
		
	}
	
}
